/**
 * enum 是有序的
 */
public enum EnumTest {
    MON("Monday", "星期一"),
    TUE("Tuesday", "星期二"),
    WED("Wednesday", "星期三"),
    THU("Thursday", "星期四"),
    FRI("Friday", "星期五"),
    SAT("Saturday", "星期六"),
    SUN("Sunday", "星期日");

    String code;
    String msg;

    EnumTest(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    String getCode() {
        return code;
    }

    String getMsg() {
        return msg;
    }

    public static void main(String[] args) {
        EnumTest[] enumTests = EnumTest.values();
        for (EnumTest enumTest : enumTests) {
//            System.out.println(enumTest.getCode());
            System.out.println(enumTest);
            //效果同上
            System.out.println("name:" + enumTest.name());
        }
    }
}
